package com.tech.mapper;

import com.tech.repository.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface UserDao {
	@Select("select * from userinfo where uname = #{username} and upassword = #{password};")
	User login(@Param("username") String username, @Param("password") String password);

	@Insert("insert into userinfo (uname, upassword, uemail) values (#{uname},#{upassword}, #{uemail});")
	@Options(useGeneratedKeys = true,keyColumn = "uid", keyProperty = "uid")
	int addUser(User user);
}
